from manimlib import *

class SelfIntroduction(Scene):
	def construct(self):
		title1 = Text("Hi，我是廖廷皞。", font = 'SourceHanSerif', font_size = 80,
		t2c = {"廖廷皞": BLUE})
		title2 = Text("欢迎来到我的动画！", font = 'SourceHanSerif', font_size = 50)
		VGroup(title1, title2).arrange(DOWN, buff = 1)
		self.play(Write(title1))
		self.wait(1)
		self.play(Write(title2))
		self.wait(3)
		self.play(FadeOut(title1),FadeOut(title2))
		self.wait()
		

		p1 = Text("我是谁？", font = 'SourceHanSerif', font_size = 70)
		p2 = Text("这可能是你想问的问题。", font = 'SourceHanSerif', font_size = 70)
		VGroup(p1, p2).arrange(DOWN, buff = 0.5)
		self.play(FadeIn(p1, DOWN))
		self.play(FadeIn(p2, UP))
		self.play(FadeOut(p1, UP), FadeOut(p2, DOWN))
		self.wait(2)
		
		p3 = Text("我是一名中学生，我整天忙碌于学习、考试，很少有时间停下来。", font = 'SourceHanSerif', font_size = 45,
			t2c = {"学习": RED, "考试": RED})
		p4 = Text("但我从未感到烦恼，因为学习也很快乐，", font = 'SourceHanSerif', font_size = 45)
		p5 = Text("我享受学习是的那份快感；", font = 'SourceHanSerif', font_size = 45)
		p6 = Text("虽然有时候会感到累，但是为了理想，必须坚持！", font = 'SourceHanSerif', font_size = 45)
		VGroup(p3, p4, p5, p6).arrange(DOWN, buff = 0.2)
		self.play(FadeIn(p3))
		self.play(FadeIn(p4))
		self.play(FadeIn(p5))
		self.play(FadeIn(p6))
		self.play(ReplacementTransform(p3, p4))
		self.play(ReplacementTransform(p4, p5))
		self.play(ReplacementTransform(p5, p6))
		self.play(p6.shift, 1.75 * UP )
